import axios from "axios";
let service = axios.create({
  timeout: 60000,
  withCredentials: false,
  headers: {
    "Content-Type": "application/json",
  },
});
//添加请求拦截器
service.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);

//添加相应拦截器
let authErroCode = [1401, 401];
service.interceptors.response.use(
  (response) => {
    let { data } = response;
    return data;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export default service;
